package com.example.module_home

import android.widget.Toast
import com.example.lib_common.BaseApplication
import com.example.lib_common.websocket.WebSocketUtils
import org.java_websocket.handshake.ServerHandshake
import java.lang.Exception

/**
 * @author yaotianxue
 * @description
 * @date 2024/10/25
 */
class App:BaseApplication() {
    override fun onCreate() {
        super.onCreate()
        initMMKV()
        initWebSocket(object : WebSocketUtils.ReceiveMsgListener {
            override fun onReceive(message: String?) {
                //发送通知
                Toast.makeText(this@App,"发送通知 $message", Toast.LENGTH_SHORT).show()
            }

            override fun onOpen(handshakedata: ServerHandshake?) {

            }

            override fun onError(ex: Exception?) {

            }

            override fun onClose(code: Int, reason: String?, remote: Boolean) {

            }

        })
    }
}